package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;

/**
 * 攻略点评
 */
@Getter@Setter@ToString
public class StrategyComment extends BaseDomain {
    public static final Integer STATE_COMMON = 0; //普通
    public static final Integer STATE_HOT = 1; //推荐
    public static final Integer STATE_DISABLE = -1; //禁用
    private User user;//作者

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date createTime;//创建时间

    private String content;//内容

    private String imgUrls;//图片

    private Integer starNum;//星星数量

    private Strategy strategy;//攻略

    private Integer state = StrategyComment.STATE_COMMON;//状态,默认普通

    private Date commendTime;//推荐时间

    public String[] getimgUrlArr(){
        return imgUrls.split(";");
    }
}